import React, { Component } from 'react';
import './NvaBar.css'
import { mapState, mapDisPatch } from '../../store/bindState'
class NavBar extends Component {
  backAction() {
    //获取浏览器的历史记录，返回
    this.props.history.go(-1);
  }
  render() {
    return (
      <div className="nav_body">
        <div className="nav">
          <div>
            {this.props.back ? <i className="iconfont icon-shangyiyehoutuifanhui-xianxingyuankuang" onClick={this.backAction.bind(this)}></i> : null}

          </div>
          <div>{this.props.title}</div>
          <div></div>
        </div>
      </div>
    );
  }
}

export default mapState(NavBar, ['back', 'title']);